#pragma once

#include "luster_int.hh"
#include "luster_string.hh"

namespace luster {

struct TestContext {
	UInt error_count{};
};

struct TestCase {
	CString name;
	CString file;
	UInt line;
	void (*func)(TestContext *);
};

#define luster_TEST(M_name) \
	static void test__##M_name(::luster::TestContext *__test_context); \
	extern "C" { \
	::luster::TestCase luster__testcase__##M_name = { \
		CString{#M_name}, \
		CString{__FILE__}, \
		__LINE__, \
		test__##M_name, \
	}; \
	} \
	static void test__##M_name(::luster::TestContext *__test_context)

void luster_cmd_test(void);

} // namespace luster
